<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>线程池: inc/threads_pool.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">线程池<span id="projectnumber">&#160;1.0.0</span>
   </div>
   <div id="projectbrief">多线程并发工具</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_bfccd401955b95cf8c75461437045ac0.html">inc</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">threads_pool.h</div></div>
</div><!--header-->
<div class="contents">
<a href="threads__pool_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="preprocessor">#ifndef __THREADS_POOL_H__</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="preprocessor">#define __THREADS_POOL_H__</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="preprocessor">#include &lt;pthread.h&gt;</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span><span class="preprocessor">#include &lt;stdbool.h&gt;</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="preprocessor">#include &lt;stdlib.h&gt;</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="preprocessor">#include &lt;errno.h&gt;</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="preprocessor">#include &lt;string.h&gt;</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span> </div>
<div class="foldopen" id="foldopen00030" data-start="{" data-end="};">
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="structtask_msg.html">   30</a></span><span class="keyword">typedef</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span><span class="keyword">struct </span><a class="code hl_struct" href="structtask_msg.html">taskMsg</a></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span>{</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="structtask_msg.html#a320a82ee2a68ce91e1c149979d694665">   33</a></span>    <span class="keywordtype">void</span>* (* handleFuncPt)(<span class="keywordtype">void</span>* arg);  </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="structtask_msg.html#a9efefa9e58ba07cae75d220d1b25c435">   34</a></span>    <span class="keywordtype">void</span>* <a class="code hl_variable" href="structtask_msg.html#a9efefa9e58ba07cae75d220d1b25c435">handleFuncArg</a>;                </div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="structtask_msg.html#ad40256cce6dd56cb02e7125af66452d9">   35</a></span>    <span class="keyword">struct </span><a class="code hl_struct" href="structtask_msg.html">taskMsg</a>* <a class="code hl_variable" href="structtask_msg.html#ad40256cce6dd56cb02e7125af66452d9">prevTaskMsgStPt</a>;    </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="structtask_msg.html#ae16f9516402596ed01dccf2233900c5e">   36</a></span>    <span class="keyword">struct </span><a class="code hl_struct" href="structtask_msg.html">taskMsg</a>* <a class="code hl_variable" href="structtask_msg.html#ae16f9516402596ed01dccf2233900c5e">nextTaskMsgStPt</a>;    </div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>}</div>
</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="threads__pool_8h.html#a7caec486a7d72810bcf5d474a87cdf0e">   38</a></span><a class="code hl_typedef" href="threads__pool_8h.html#a7caec486a7d72810bcf5d474a87cdf0e">TaskMsg_st</a>, *<a class="code hl_typedef" href="threads__pool_8h.html#abf857be8d505f4cc5457764683476a96">TaskMsg_st_pt</a>;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span> </div>
<div class="foldopen" id="foldopen00044" data-start="{" data-end="};">
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="structthread_msg.html">   44</a></span><span class="keyword">typedef</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span><span class="keyword">struct </span><a class="code hl_struct" href="structthread_msg.html">threadMsg</a></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>{</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="structthread_msg.html#ae68dfff2f96d2414dfbd3959a79e1b43">   47</a></span>    pthread_t <a class="code hl_variable" href="structthread_msg.html#ae68dfff2f96d2414dfbd3959a79e1b43">tid</a>;                      </div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="structthread_msg.html#a57a24de45c24628dfe6fb14cd10a868a">   48</a></span>    <span class="keyword">struct </span><a class="code hl_struct" href="structthread_msg.html">threadMsg</a>* <a class="code hl_variable" href="structthread_msg.html#a57a24de45c24628dfe6fb14cd10a868a">prevTrdMsgStPt</a>;   </div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="structthread_msg.html#affe4d46391e29e73eba06baa6897baac">   49</a></span>    <span class="keyword">struct </span><a class="code hl_struct" href="structthread_msg.html">threadMsg</a>* <a class="code hl_variable" href="structthread_msg.html#affe4d46391e29e73eba06baa6897baac">nextTrdMsgStPt</a>;   </div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span>}</div>
</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="threads__pool_8h.html#aa588c06cf4a4c4a03c25a9e11086b492">   51</a></span><a class="code hl_typedef" href="threads__pool_8h.html#aa588c06cf4a4c4a03c25a9e11086b492">ThreadMsg_st</a>, *<a class="code hl_typedef" href="threads__pool_8h.html#ae4d780691b4e7bc3472f4612e32a9c58">ThreadMsg_st_pt</a>;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span> </div>
<div class="foldopen" id="foldopen00057" data-start="{" data-end="};">
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="structthreads_pool_msg.html">   57</a></span><span class="keyword">typedef</span></div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span><span class="keyword">struct </span><a class="code hl_struct" href="structthreads_pool_msg.html">threadsPoolMsg</a></div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>{</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="structthreads_pool_msg.html#a80ed574e122423cf9ffafd4b2d1cfb9c">   60</a></span>    pthread_mutex_t <a class="code hl_variable" href="structthreads_pool_msg.html#a80ed574e122423cf9ffafd4b2d1cfb9c">mtxUn</a>;                  </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="structthreads_pool_msg.html#a0fb5277da524002442dfdd04bd95a852">   61</a></span>    pthread_cond_t <a class="code hl_variable" href="structthreads_pool_msg.html#a0fb5277da524002442dfdd04bd95a852">codUn</a>;                   </div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="structthreads_pool_msg.html#a0a0f5965804f3bc796600f6ecf66ba20">   62</a></span>    <span class="keywordtype">bool</span> <a class="code hl_variable" href="structthreads_pool_msg.html#a0a0f5965804f3bc796600f6ecf66ba20">shutDown</a>;                          </div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="structthreads_pool_msg.html#a8281735069450c11d1154f0dce28f083">   63</a></span>    <span class="keywordtype">int</span> <a class="code hl_variable" href="structthreads_pool_msg.html#a8281735069450c11d1154f0dce28f083">waitingTasksCot</a>;                    </div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="structthreads_pool_msg.html#a67c4752b08cc34e3217c42abbbabd719">   64</a></span>    <span class="keywordtype">int</span> <a class="code hl_variable" href="structthreads_pool_msg.html#a67c4752b08cc34e3217c42abbbabd719">activeThreadsCot</a>;                   </div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="structthreads_pool_msg.html#a78a0c6c3b579b2099ac3e12e8e5ada62">   65</a></span>    <span class="keywordtype">int</span> <a class="code hl_variable" href="structthreads_pool_msg.html#a78a0c6c3b579b2099ac3e12e8e5ada62">maxWaitingTasksCot</a>;                 </div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="structthreads_pool_msg.html#aa383e3c726e24f65bd04b8559d74afec">   66</a></span>    <span class="keywordtype">int</span> <a class="code hl_variable" href="structthreads_pool_msg.html#aa383e3c726e24f65bd04b8559d74afec">maxActiveThreadsCot</a>;                </div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="structthreads_pool_msg.html#aefa9644b2c0e4132e99fd66a751fa38a">   67</a></span>    <a class="code hl_struct" href="structtask_msg.html">TaskMsg_st_pt</a> <a class="code hl_variable" href="structthreads_pool_msg.html#aefa9644b2c0e4132e99fd66a751fa38a">tasksLinkedQueueEntr</a>;     </div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="structthreads_pool_msg.html#a0f16ca9c117fe8e1a878720fb801e4e1">   68</a></span>    <a class="code hl_struct" href="structthread_msg.html">ThreadMsg_st_pt</a> <a class="code hl_variable" href="structthreads_pool_msg.html#a0f16ca9c117fe8e1a878720fb801e4e1">threadsLinkedListEntr</a>;  </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>}</div>
</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="threads__pool_8h.html#a6f01da986f606db591863f482cf7c21a">   70</a></span><a class="code hl_typedef" href="threads__pool_8h.html#a6f01da986f606db591863f482cf7c21a">ThreadsPoolMsg_st</a>, *<a class="code hl_typedef" href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a>;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span> </div>
<div class="foldopen" id="foldopen00080" data-start="" data-end="">
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="threads__pool_8h.html#ade228054bfa068c8720ccbdd9bd60f1f">   80</a></span><span class="preprocessor">#define READY_CLEAN_UP_AND_LOCK(cleanUpHandleFuncPt, mtxUnPt) \</span></div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span><span class="preprocessor">    pthread_cleanup_push((cleanUpHandleFuncPt), (mtxUnPt)); \</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span><span class="preprocessor">    pthread_mutex_lock((mtxUnPt));</span></div>
</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span> </div>
<div class="foldopen" id="foldopen00091" data-start="" data-end="">
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="threads__pool_8h.html#aad77b3322f3824da508dfbd0d04aa1a3">   91</a></span><span class="preprocessor">#define UNLOCK_AND_CANCEL_CLEAN_UP(mtxUnPt) \</span></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span><span class="preprocessor">    pthread_mutex_unlock((mtxUnPt)); \</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span><span class="preprocessor">    pthread_cleanup_pop(0);</span></div>
</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span> </div>
<div class="foldopen" id="foldopen00100" data-start="" data-end="">
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="threads__pool_8h.html#aab550e9b3cc1d47242c9baf6ad76334a">  100</a></span><span class="preprocessor">#define SHOW_DEBUG \</span></div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span><span class="preprocessor">    fprintf(stderr, &quot;| FILE: %s | FUNC: %s  | LINE: %d  |\n&quot;, __FILE__, __FUNCTION__, __LINE__);</span></div>
</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span> </div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span><a class="code hl_struct" href="structthreads_pool_msg.html">ThreadsPoolMsg_st_pt</a> <a class="code hl_function" href="threads__pool_8h.html#a871605529dee3dac1537de63589ab108">getNewThreadsPoolMsg</a> (<span class="keywordtype">int</span> orgActiveThreadsCot, <span class="keywordtype">int</span> maxWaitingTasksCot, <span class="keywordtype">int</span> maxActiveThreadsCot);</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span> </div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span><span class="keywordtype">int</span> <a class="code hl_function" href="threads__pool_8h.html#a3ceec63a2e1c63606f561486b0b24e72">addNewTask</a> (<a class="code hl_struct" href="structthreads_pool_msg.html">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt, <span class="keywordtype">void</span>* (* handleFuncPt)(<span class="keywordtype">void</span>* arg), <span class="keywordtype">void</span>* handleFuncArg);</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span> </div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span><span class="keywordtype">int</span> <a class="code hl_function" href="threads__pool_8h.html#a7ebefc9eea4454da73914b2e62c3ef54">reduceTask</a> (<a class="code hl_struct" href="structthreads_pool_msg.html">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt, <span class="keywordtype">void</span>* (* destHandleFuncPt)(<span class="keywordtype">void</span>* arg));</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span> </div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span><span class="keywordtype">int</span> <a class="code hl_function" href="threads__pool_8h.html#a3c97656e7bb9d4709eca4ed29abf9d9c">addThread</a> (<a class="code hl_struct" href="structthreads_pool_msg.html">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt);</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span> </div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span><span class="keywordtype">int</span> <a class="code hl_function" href="threads__pool_8h.html#afbfdf354a44f65186b3dfdd80e566b59">reduceThread</a> (<a class="code hl_struct" href="structthreads_pool_msg.html">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt);</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno">  162</span> </div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span><span class="keywordtype">void</span> <a class="code hl_function" href="threads__pool_8h.html#a9ebf8832444bfb71e5cc1549ec38e354">destroyThreadsPoolMsg</a> (<a class="code hl_struct" href="structthreads_pool_msg.html">ThreadsPoolMsg_st_pt</a> trdsPolMsgStPt);</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno">  172</span> </div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span> </div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="astructtask_msg_html"><div class="ttname"><a href="structtask_msg.html">taskMsg</a></div><div class="ttdoc">任务信息结构体</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00030">threads_pool.h:32</a></div></div>
<div class="ttc" id="astructtask_msg_html_a9efefa9e58ba07cae75d220d1b25c435"><div class="ttname"><a href="structtask_msg.html#a9efefa9e58ba07cae75d220d1b25c435">taskMsg::handleFuncArg</a></div><div class="ttdeci">void * handleFuncArg</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00034">threads_pool.h:34</a></div></div>
<div class="ttc" id="astructtask_msg_html_ad40256cce6dd56cb02e7125af66452d9"><div class="ttname"><a href="structtask_msg.html#ad40256cce6dd56cb02e7125af66452d9">taskMsg::prevTaskMsgStPt</a></div><div class="ttdeci">struct taskMsg * prevTaskMsgStPt</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00035">threads_pool.h:35</a></div></div>
<div class="ttc" id="astructtask_msg_html_ae16f9516402596ed01dccf2233900c5e"><div class="ttname"><a href="structtask_msg.html#ae16f9516402596ed01dccf2233900c5e">taskMsg::nextTaskMsgStPt</a></div><div class="ttdeci">struct taskMsg * nextTaskMsgStPt</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00036">threads_pool.h:36</a></div></div>
<div class="ttc" id="astructthread_msg_html"><div class="ttname"><a href="structthread_msg.html">threadMsg</a></div><div class="ttdoc">线程信息结构体</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00044">threads_pool.h:46</a></div></div>
<div class="ttc" id="astructthread_msg_html_a57a24de45c24628dfe6fb14cd10a868a"><div class="ttname"><a href="structthread_msg.html#a57a24de45c24628dfe6fb14cd10a868a">threadMsg::prevTrdMsgStPt</a></div><div class="ttdeci">struct threadMsg * prevTrdMsgStPt</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00048">threads_pool.h:48</a></div></div>
<div class="ttc" id="astructthread_msg_html_ae68dfff2f96d2414dfbd3959a79e1b43"><div class="ttname"><a href="structthread_msg.html#ae68dfff2f96d2414dfbd3959a79e1b43">threadMsg::tid</a></div><div class="ttdeci">pthread_t tid</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00047">threads_pool.h:47</a></div></div>
<div class="ttc" id="astructthread_msg_html_affe4d46391e29e73eba06baa6897baac"><div class="ttname"><a href="structthread_msg.html#affe4d46391e29e73eba06baa6897baac">threadMsg::nextTrdMsgStPt</a></div><div class="ttdeci">struct threadMsg * nextTrdMsgStPt</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00049">threads_pool.h:49</a></div></div>
<div class="ttc" id="astructthreads_pool_msg_html"><div class="ttname"><a href="structthreads_pool_msg.html">threadsPoolMsg</a></div><div class="ttdoc">线程池信息结构体</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00057">threads_pool.h:59</a></div></div>
<div class="ttc" id="astructthreads_pool_msg_html_a0a0f5965804f3bc796600f6ecf66ba20"><div class="ttname"><a href="structthreads_pool_msg.html#a0a0f5965804f3bc796600f6ecf66ba20">threadsPoolMsg::shutDown</a></div><div class="ttdeci">bool shutDown</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00062">threads_pool.h:62</a></div></div>
<div class="ttc" id="astructthreads_pool_msg_html_a0f16ca9c117fe8e1a878720fb801e4e1"><div class="ttname"><a href="structthreads_pool_msg.html#a0f16ca9c117fe8e1a878720fb801e4e1">threadsPoolMsg::threadsLinkedListEntr</a></div><div class="ttdeci">ThreadMsg_st_pt threadsLinkedListEntr</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00068">threads_pool.h:68</a></div></div>
<div class="ttc" id="astructthreads_pool_msg_html_a0fb5277da524002442dfdd04bd95a852"><div class="ttname"><a href="structthreads_pool_msg.html#a0fb5277da524002442dfdd04bd95a852">threadsPoolMsg::codUn</a></div><div class="ttdeci">pthread_cond_t codUn</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00061">threads_pool.h:61</a></div></div>
<div class="ttc" id="astructthreads_pool_msg_html_a67c4752b08cc34e3217c42abbbabd719"><div class="ttname"><a href="structthreads_pool_msg.html#a67c4752b08cc34e3217c42abbbabd719">threadsPoolMsg::activeThreadsCot</a></div><div class="ttdeci">int activeThreadsCot</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00064">threads_pool.h:64</a></div></div>
<div class="ttc" id="astructthreads_pool_msg_html_a78a0c6c3b579b2099ac3e12e8e5ada62"><div class="ttname"><a href="structthreads_pool_msg.html#a78a0c6c3b579b2099ac3e12e8e5ada62">threadsPoolMsg::maxWaitingTasksCot</a></div><div class="ttdeci">int maxWaitingTasksCot</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00065">threads_pool.h:65</a></div></div>
<div class="ttc" id="astructthreads_pool_msg_html_a80ed574e122423cf9ffafd4b2d1cfb9c"><div class="ttname"><a href="structthreads_pool_msg.html#a80ed574e122423cf9ffafd4b2d1cfb9c">threadsPoolMsg::mtxUn</a></div><div class="ttdeci">pthread_mutex_t mtxUn</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00060">threads_pool.h:60</a></div></div>
<div class="ttc" id="astructthreads_pool_msg_html_a8281735069450c11d1154f0dce28f083"><div class="ttname"><a href="structthreads_pool_msg.html#a8281735069450c11d1154f0dce28f083">threadsPoolMsg::waitingTasksCot</a></div><div class="ttdeci">int waitingTasksCot</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00063">threads_pool.h:63</a></div></div>
<div class="ttc" id="astructthreads_pool_msg_html_aa383e3c726e24f65bd04b8559d74afec"><div class="ttname"><a href="structthreads_pool_msg.html#aa383e3c726e24f65bd04b8559d74afec">threadsPoolMsg::maxActiveThreadsCot</a></div><div class="ttdeci">int maxActiveThreadsCot</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00066">threads_pool.h:66</a></div></div>
<div class="ttc" id="astructthreads_pool_msg_html_aefa9644b2c0e4132e99fd66a751fa38a"><div class="ttname"><a href="structthreads_pool_msg.html#aefa9644b2c0e4132e99fd66a751fa38a">threadsPoolMsg::tasksLinkedQueueEntr</a></div><div class="ttdeci">TaskMsg_st_pt tasksLinkedQueueEntr</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8h_source.html#l00067">threads_pool.h:67</a></div></div>
<div class="ttc" id="athreads__pool_8h_html_a3c97656e7bb9d4709eca4ed29abf9d9c"><div class="ttname"><a href="threads__pool_8h.html#a3c97656e7bb9d4709eca4ed29abf9d9c">addThread</a></div><div class="ttdeci">int addThread(ThreadsPoolMsg_st_pt trdsPolMsgStPt)</div><div class="ttdoc">向线程池中添加新线程</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8c_source.html#l00456">threads_pool.c:456</a></div></div>
<div class="ttc" id="athreads__pool_8h_html_a3ceec63a2e1c63606f561486b0b24e72"><div class="ttname"><a href="threads__pool_8h.html#a3ceec63a2e1c63606f561486b0b24e72">addNewTask</a></div><div class="ttdeci">int addNewTask(ThreadsPoolMsg_st_pt trdsPolMsgStPt, void *(*handleFuncPt)(void *arg), void *handleFuncArg)</div><div class="ttdoc">添加新任务到线程池</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8c_source.html#l00396">threads_pool.c:396</a></div></div>
<div class="ttc" id="athreads__pool_8h_html_a5a467b16d23990346745beeffa68a36f"><div class="ttname"><a href="threads__pool_8h.html#a5a467b16d23990346745beeffa68a36f">ThreadsPoolMsg_st_pt</a></div><div class="ttdeci">struct threadsPoolMsg * ThreadsPoolMsg_st_pt</div></div>
<div class="ttc" id="athreads__pool_8h_html_a6f01da986f606db591863f482cf7c21a"><div class="ttname"><a href="threads__pool_8h.html#a6f01da986f606db591863f482cf7c21a">ThreadsPoolMsg_st</a></div><div class="ttdeci">struct threadsPoolMsg ThreadsPoolMsg_st</div><div class="ttdoc">线程池信息结构体</div></div>
<div class="ttc" id="athreads__pool_8h_html_a7caec486a7d72810bcf5d474a87cdf0e"><div class="ttname"><a href="threads__pool_8h.html#a7caec486a7d72810bcf5d474a87cdf0e">TaskMsg_st</a></div><div class="ttdeci">struct taskMsg TaskMsg_st</div><div class="ttdoc">任务信息结构体</div></div>
<div class="ttc" id="athreads__pool_8h_html_a7ebefc9eea4454da73914b2e62c3ef54"><div class="ttname"><a href="threads__pool_8h.html#a7ebefc9eea4454da73914b2e62c3ef54">reduceTask</a></div><div class="ttdeci">int reduceTask(ThreadsPoolMsg_st_pt trdsPolMsgStPt, void *(*destHandleFuncPt)(void *arg))</div><div class="ttdoc">从线程池中移除指定任务</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8c_source.html#l00431">threads_pool.c:431</a></div></div>
<div class="ttc" id="athreads__pool_8h_html_a871605529dee3dac1537de63589ab108"><div class="ttname"><a href="threads__pool_8h.html#a871605529dee3dac1537de63589ab108">getNewThreadsPoolMsg</a></div><div class="ttdeci">ThreadsPoolMsg_st_pt getNewThreadsPoolMsg(int orgActiveThreadsCot, int maxWaitingTasksCot, int maxActiveThreadsCot)</div><div class="ttdoc">创建新的线程池</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8c_source.html#l00366">threads_pool.c:366</a></div></div>
<div class="ttc" id="athreads__pool_8h_html_a9ebf8832444bfb71e5cc1549ec38e354"><div class="ttname"><a href="threads__pool_8h.html#a9ebf8832444bfb71e5cc1549ec38e354">destroyThreadsPoolMsg</a></div><div class="ttdeci">void destroyThreadsPoolMsg(ThreadsPoolMsg_st_pt trdsPolMsgStPt)</div><div class="ttdoc">销毁线程池</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8c_source.html#l00556">threads_pool.c:556</a></div></div>
<div class="ttc" id="athreads__pool_8h_html_aa588c06cf4a4c4a03c25a9e11086b492"><div class="ttname"><a href="threads__pool_8h.html#aa588c06cf4a4c4a03c25a9e11086b492">ThreadMsg_st</a></div><div class="ttdeci">struct threadMsg ThreadMsg_st</div><div class="ttdoc">线程信息结构体</div></div>
<div class="ttc" id="athreads__pool_8h_html_abf857be8d505f4cc5457764683476a96"><div class="ttname"><a href="threads__pool_8h.html#abf857be8d505f4cc5457764683476a96">TaskMsg_st_pt</a></div><div class="ttdeci">struct taskMsg * TaskMsg_st_pt</div></div>
<div class="ttc" id="athreads__pool_8h_html_ae4d780691b4e7bc3472f4612e32a9c58"><div class="ttname"><a href="threads__pool_8h.html#ae4d780691b4e7bc3472f4612e32a9c58">ThreadMsg_st_pt</a></div><div class="ttdeci">struct threadMsg * ThreadMsg_st_pt</div></div>
<div class="ttc" id="athreads__pool_8h_html_afbfdf354a44f65186b3dfdd80e566b59"><div class="ttname"><a href="threads__pool_8h.html#afbfdf354a44f65186b3dfdd80e566b59">reduceThread</a></div><div class="ttdeci">int reduceThread(ThreadsPoolMsg_st_pt trdsPolMsgStPt)</div><div class="ttdoc">从线程池中移除线程</div><div class="ttdef"><b>Definition</b> <a href="threads__pool_8c_source.html#l00486">threads_pool.c:486</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2025年 九月 13日 星期六 03:22:59 , 为 线程池使用 &#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>
